<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="jt" uri="http://www.jsoft.org/tags/jsoft"%>
<%@ taglib prefix="jh" uri="http://www.jsoft.org/tags/jsoft-html"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	if(path!=null&&path.equals("/")){
	   path="";
	} 
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>系统Link(URL)列表</title>
		<link href="<%=basePath%>admin/styles/default.css" rel="stylesheet"
			type="text/css" />
		<link href="<%=basePath%>admin/styles/page.css" rel="stylesheet"
			type="text/css" />
		<script type="text/javascript">
		function editor(id,name,des,state)
		{
			document.all.id_txt.innerHTML = id;
			document.all.id.value = id;
			document.all.name.value = name;
			document.all.des.value = des;
			document.all.state.value = state;
		}
		function form_reset()
		{
			document.all.id_txt.innerHTML = "新增Link";
			return true;
		}
		function form_delete(href)
		{
			if(confirm("您确定要删除吗？执行删除后数据将无法恢复！"))
			{
   				window.location.href = href;
   			}			
		}
		</script>
	</head>

	<body>
		<div class="title">
			<h2>
				系统Link(URL)列表
			</h2>
		</div>
		<div id="container">
			<!-- table -->
			<div><font color="red">${requestScope.saveMsg}</font></div>
			<div id="info">
				<form action="<%=basePath%>manager/link/save.do" method="post">
					<table width="100%" cellpadding="3" cellspacing="1" border="0" bgcolor="#e3e3e3">
						<tr bgcolor="#FFFFFF">
							<td width="100" nowrap="nowrap" bgcolor="#f7fbff">编号</td>
							<td>
								<font color="bule" id="id_txt">${requestScope.editLink.id}</font>
								<input type="hidden" name="id" id="id" value="${requestScope.editLink.id}" />
							</td>
							<td width="100" nowrap="nowrap" bgcolor="#f7fbff">状态</td>
							<td>
								<select name="state" id="state">
									<option value="1" <c:if test="${requestScope.editLink.state eq 1}">selected="selected"</c:if>>- 启用 -</option>
									<option value="0" <c:if test="${requestScope.editLink.state eq 0}">selected="selected"</c:if>>- 停用 -</option>
								</select>
							</td>
							<td colspan="2" nowrap="nowrap" width="30%">
								<input type="submit" value="保存/修改" class="button" />
								<input type="reset" value="重置" class="button" />
								<input type="button" value="重新添加" class="button" onclick="window.location.href='<%=basePath%>manager/link/list.do';" />
								<input type="hidden" name="page" value="${requestScope.PAGEMODEL.pageNum}"/>
							</td>
						</tr>
						<tr bgcolor="#FFFFFF">
							<td width="100" nowrap="nowrap" bgcolor="#f7fbff">名称</td>
							<td>
								<input name="name" id="name" type="text" class="text" value="${requestScope.editLink.name}" />
							</td>
							<td width="100" nowrap="nowrap" bgcolor="#f7fbff">标题</td>
							<td>
								<input name="title" id="title" type="text" class="text" value="${requestScope.editLink.title}" />
							</td>
							<td colspan="2"></td>
						</tr>
						<tr bgcolor="#FFFFFF">
							<td width="100" nowrap="nowrap" bgcolor="#f7fbff">Link(Url)</td>
							<td colspan="5">
								<input name="linkUrl" id="linkUrl" type="text" class="text" value="${requestScope.editLink.linkUrl}" style="width: 400px;" />
								注：以斜线开头，如：http://www.qdjavasoft.com<font color="red">/admin/main.jsp</font>。
							</td>
						</tr>
					</table>
				</form>
				<div style="height: 10px;"></div>
			</div>
			<table class="table01">
				<tr>
					<th>编号</th>
					<th>名称</th>
					<th>标题</th>
					<th>Link(Url)</th>
					<th>状态</th>
					<th width="70">操作</th>
				</tr>
				<c:forEach items="${requestScope.linkList}" var="link">
				<tr <c:if test="${requestScope.editLink.id eq link.id}">class="selected"</c:if>>
					<td><c:out value="${link.id}"/></td>
					<td><c:out value="${link.name}"/></td>
					<td><c:out value="${link.title}"/></td>
					<td><c:out value="${link.linkUrl}"/></td>
					<td>
						<c:if test="${link.state eq 1}"><font color="blue">启用</font></c:if>
						<c:if test="${link.state eq 0}"><font color="red">停用</font></c:if>
						(<c:out value="${link.state}"/>)
					</td>
					<td>
						<a href="<%=basePath%>manager/link/edit.do?id=${link.id}&page=${requestScope.PAGEMODEL.pageNum}">修改</a>
						<a href="javascript:form_delete('<%=basePath%>manager/link/delete.do?id=${link.id}');">删除</a>
					</td>
				</tr>
				</c:forEach>
			</table>
			<jt:page/>
		</div>
	</body>
</html>
